<?xml version="1.0" encoding= "UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/templates/common.xhtml">
	<ui:define name="content">
		<f:metadata>
			<f:viewParam name="id" value="#{profileBean.userId}" />
		</f:metadata>
		<h:form id="userinfo">
			<h2 style="margin-left: 20px">
				#{profileBean.currentUser.firstName}
				#{profileBean.currentUser.lastName}
				<h:outputText value="- It's your page"
					rendered="#{profileBean.selfPageVisitor}" style="margin-left:40px" />
			</h2>

			<h:outputText value="online"
				rendered="#{profileBean.currentUser.online}"
				style="margin-left:40px" />


			<p:commandButton id="buttonadd" value="Add as Friend"
				rendered="#{(!profileBean.selfPageVisitor ) and (!profileBean.friendOfSelf) and (not empty userBean.self)}"
				style="margin-left: 20px" actionListener="#{profileBean.addFriend}"
				update="userinfo,lists" />
			<p:message for="buttonadd" />
			<p:panelGrid columns="2" style="width:95%;margin-left:10px">


				<h:outputText id="fname" value="First name:"
					rendered="#{not empty profileBean.currentUser.firstName}" />

				<h:outputText value="#{profileBean.currentUser.firstName}"
					rendered="#{not empty profileBean.currentUser.firstName}" />

				<h:outputText value="Last name:"
					rendered="#{not empty profileBean.currentUser.lastName}" />
				<h:outputText value="#{profileBean.currentUser.lastName}"
					rendered="#{not empty profileBean.currentUser.lastName}" />

				<h:outputText value="Gender:"
					rendered="#{not empty profileBean.currentUser.gender}" />
				<h:outputText value="#{profileBean.currentUser.gender}"
					rendered="#{not empty profileBean.currentUser.gender}" />

				<h:outputText value="Birthday date:"
					rendered="#{not empty profileBean.currentUser.birthdayDate}" />
				<h:outputText converter="javax.faces.DateTime"
					value="#{profileBean.currentUser.birthdayDate}"
					rendered="#{not empty profileBean.currentUser.birthdayDate}" />

				<h:outputText value="Status:"
					rendered="#{not empty profileBean.currentUser.status}" />
				<h:outputText value="#{profileBean.currentUser.status}"
					rendered="#{not empty profileBean.currentUser.status}" />

				<h:outputText value="Phone:"
					rendered="#{not empty profileBean.currentUser.phone}" />
				<h:outputText value="#{profileBean.currentUser.phone}"
					rendered="#{not empty profileBean.currentUser.phone}" />

				<h:outputText value="Web site:"
					rendered="#{not empty profileBean.currentUser.webSite}" />
				<h:outputText value="#{profileBean.currentUser.webSite}"
					rendered="#{not empty profileBean.currentUser.webSite}" />

				<h:outputText value="Address:"
					rendered="#{not empty profileBean.currentUser.address}" />
				<h:outputText value="#{profileBean.currentUser.address}"
					rendered="#{not empty profileBean.currentUser.address}" />

				<h:outputText value="Marital state:"
					rendered="#{not empty profileBean.currentUser.maritalState}" />
				<h:outputText value="#{profileBean.currentUser.maritalState}"
					rendered="#{not empty profileBean.currentUser.maritalState}" />

				<h:outputText value="Country:"
					rendered="#{not empty profileBean.currentUser.userCountry.countryName}" />
				<h:outputText
					value="#{profileBean.currentUser.userCountry.countryName}"
					rendered="#{not empty profileBean.currentUser.userCountry.countryName}" />

				<h:outputText value="City:"
					rendered="#{not empty profileBean.currentUser.userCity.cityName}" />
				<h:outputText value="#{profileBean.currentUser.userCity.cityName}"
					rendered="#{not empty profileBean.currentUser.userCity.cityName}" />

			</p:panelGrid>

			<p:accordionPanel multiple="true" style="width:95%;margin-left:10px"
				id="lists">
				<p:tab title="Educations">


					<ui:include src="/user/educations.xhtml" />

				</p:tab>

				<p:tab title="Jobs">

					<ui:include src="/user/jobs.xhtml" />

				</p:tab>

				<p:tab title="Friends">

					<ui:include src="/user/friends.xhtml" />

				</p:tab>
				<p:tab title="Events">

					<ui:include src="/user/events.xhtml" />

				</p:tab>
				<p:tab title="Forums">

					<ui:include src="/user/forums.xhtml" />

				</p:tab>
				<p:tab title="Interests">

					<ui:include src="/user/interests.xhtml" />

				</p:tab>
			</p:accordionPanel>
		</h:form>
	</ui:define>

</ui:composition>


</html>

